<?php

class Back_Form_Login extends Jnd_Form
{

    public function __construct ($decorateur = "Formulaire", $options = null)
    {
        parent::__construct($decorateur, $options);
        $this->setElementDecorators(
                array(
                        "$decorateur"
                ), array(), false);
    }

    public function init ()
    {
        $this->setName("login");
        $this->setMethod("post");
        $this->setAction("/back/index/connexion");
        
        $champ = new Zend_Form_Element_Text("login");
        $champ->setLabel(__("Utilisateur"));
        $champ->setRequired(true);
        $champ->setAttrib("class", "login-inp");
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Password("motdepasse");
        $champ->setLabel(__("Mot de passe"));
        $champ->setAttrib("class", "login-inp");
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Checkbox("retenir");
        $champ->setLabel(__("Rester connecté"));
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Text("email");
        $champ->setLabel(
                __("Indiquez votre email et nous changerons votre mot de passe"));
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Submit("submit");
        $champ->setAttrib("class", "submit-login");
        $champs[] = $champ;
        
        $this->addElements($champs);
    }
}

